<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <title>订单详情</title>
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="../css/bui.css" />
</head>
<body>
<style>
    .page-form .bui-fluid-space-3 .span1 {
        margin-bottom: .2rem;
    }

    .selected-val {
        margin-right: .1rem;
    }
</style>
<div class="bui-page page-form">
    <header class="bui-bar">
        <div class="bui-bar-left"> <a class="bui-btn btn-back" id="backupButton" ><i class="icon-back"></i></a> </div>
        <div class="bui-bar-main">订单详情</div>
        <div class="bui-bar-right"> </div>
    </header>
    <main>
        <div class="bui-list">
            <label class="bui-btn bui-box">
                <div class="bui-label">订单编码</div>
                <div class="span1">
                    <div class="bui-value" id="bm">&nbsp;</div>
                </div>
            </label>
            <label class="bui-btn bui-box">
                <div class="bui-label">订单时间</div>
                <div class="span1">
                    <div class="bui-value" id="ddsj">&nbsp;</div>
                </div>
            </label>
            <label class="bui-btn bui-box">
                <div class="bui-label">申请人</div>
                <div class="span1">
                    <div class="bui-value" id="sqr">&nbsp;</div>
                </div>
            </label>
            <label class="bui-btn bui-box">
                <div class="bui-label">订单状态</div>
                <div class="span1">
                    <div class="bui-value" id="ddzt">&nbsp;</div>
                </div>
            </label>
            <label class="bui-btn bui-box">
                <div class="bui-label">单价（元/公斤）</div>
                <div class="span1">
                    <div class="bui-value" id="dj">&nbsp;</div>
                </div>
            </label>
            <label class="bui-btn bui-box">
                <div class="bui-label">重量（公斤）</div>
                <div class="span1">
                    <div class="bui-value" id="zl">&nbsp;</div>
                </div>
            </label>
            <label class="bui-btn bui-box">
                <div class="bui-label">数量（头）</div>
                <div class="span1">
                    <div class="bui-value" id="sl">&nbsp;</div>
                </div>
            </label>
            <label class="bui-btn bui-box">
                <div class="bui-label">签订合同时间</div>
                <div class="span1">
                    <div class="bui-value" id="qdhtsj">&nbsp;</div>
                </div>
            </label>
            <label class="bui-btn bui-box">
                <div class="bui-label">养殖户付款时间</div>
                <div class="span1">
                    <div class="bui-value" id="yzhfksj">&nbsp;</div>
                </div>
            </label>

            <label class="bui-btn bui-box">
                <div class="bui-label">司机</div>
                <div class="span1">
                    <div class="bui-value" id="sj">&nbsp;</div>
                </div>
            </label>
            <label class="bui-btn bui-box">
                <div class="bui-label">付款时间</div>
                <div class="span1">
                    <div class="bui-value" id="fksj">&nbsp;</div>
                </div>
            </label>
            <label class="bui-btn bui-box">
                <div class="bui-label">位置</div>
                <div class="span1">
                    <div class="bui-value" id="wz">&nbsp;</div>
                </div>
            </label>
        </div>

    </main>
</div>
    <!-- 依赖库 手机调试的js引用顺序如下 -->
    <script src="../js/zepto.js"></script>
    <script src="../js/plugins/fastclick.js"></script>
    <script src="../js/bui.js"></script>
    <script src="../js/common.js"></script>
    <script>
        bui.ready(function () {
            initCommon(bui);
            var uiParams = bui.getPageParams();
            uiParams.done(function(result){
                var urlparam = result;
                console.log(urlparam)
                var ddbm = urlparam.ddbm;
                if(ddbm){
                    var detailAjax = bui.ajax({
                        url: BASE_URL+"/front/orderDetail",
                        // 可选参数
                        data: {
                            ddbm:ddbm
                        },
                        method: "GET"
                    });
                    detailAjax.then(function(res) {
                        if(res.code == 0){
                            var order  = res.data;
                            if(order){
                                var zttext = "";
                                if(order.ZT == 0){
                                    zttext = "<font color='red'>已提交</font>";
                                }else if(order.ZT == 1){
                                    zttext = "已签合同";
                                }else if(order.ZT == 2){
                                    zttext = "<font color='green'>已完成</font>";
                                }
                                $("#bm").html(order.BM||"");
                                $("#ddsj").html(order.DDSJ||"");
                                $("#sqr").html(order.CZCXM||"");
                                $("#ddzt").html(zttext);
                                $("#dj").html(order.DJ||"");
                                $("#zl").html(order.ZL||"");
                                $("#sl").html(order.SL||"");
                                $("#sj").html(order.XM||"");
                                $("#fksj").html(order.FKSJ||"");
                                $("#wz").html("<a href='"+order.WZ+"'>交流详情</a>");
                                $("#qdhtsj").html(order.QDHTSJ||"");
                                $("#yzhfksj").html(order.FKYZHSJ||"");
                            }
                        }else{
                            bui.alert(res.msg);
                        }
                    },function(res) {
                        bui.alert("请求异常");
                    })
                }
            })
            bui.btn({id: ".bui-page", handle: ".bui-btn"}).load();

            $("#backupButton").on("click", function (argument) {
                window.location.href = "home.html";
            });


        })
    </script>
</body>
</html>